package com.api.league.model;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author RenQiang
 * @date 2021/5/30
 */
@Data
@Table(name = "league_standing")
public class LeagueStanding implements Serializable {
    private static final long serialVersionUID = -7134121653595195629L;

    public LeagueStanding() {
    }

    public LeagueStanding(Long matchDayId, Long teamId, Integer p, Integer w, Integer d, Integer l, Integer f, Integer a, Integer diff, Integer point) {
        this.matchDayId = matchDayId;
        this.teamId = teamId;
        this.p = p;
        this.w = w;
        this.d = d;
        this.l = l;
        this.f = f;
        this.a = a;
        this.diff = diff;
        this.point = point;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;
    /**
     * 比赛日ID
     */
    @Column(name = "match_day_id")
    private Long matchDayId;
    /**
     * 战队ID
     */
    @Column(name = "team_id")
    private Long teamId;
    /**
     * 对局次数（played）
     */
    @Column(name = "p")
    private Integer p;
    /**
     * 胜场数（赢了记2分）
     */
    @Column(name = "w")
    private Integer w;
    /**
     * 平场数（平局记1分）
     */
    @Column(name = "d")
    private Integer d;
    /**
     * 败场数（输了记0分）
     */
    @Column(name = "l")
    private Integer l;
    /**
     * 累计成绩（每场成绩之和）
     */
    @Column(name = "f")
    private Integer f;
    /**
     * 累计反向成绩（对手的成绩之和）
     */
    @Column(name = "a")
    private Integer a;
    /**
     * 成绩与反向成绩之差
     */
    @Column(name = "diff")
    private Integer diff;
    /**
     * 最终分数
     */
    @Column(name = "point")
    private Integer point;
}
